package com.jmp.feign;

import one.stand.fallback.WechatAdminFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author Administrator
 */
@FeignClient(value = "wechat-service", fallback = WechatAdminFallBack.class, decode404 = true)
public interface WechatAdminFegin {

    /**
     * 获取代码草稿
     *
     * @return
     */
    @PostMapping("code/template/getTemplateDraftList")
    String getTemplateDraftList();

    /**
     * 获取所有模板
     *
     * @return
     */
    @PostMapping("code/template/getTemplateList")
    String getTemplateList();

    /**
     * 把草稿存为模板
     *
     * @param draftId
     * @return
     */
    @PostMapping("code/template/addTotemplate")
    String addTotemplate(@RequestParam("draftId") String draftId);

    /**
     * 代码提交到相应小程序
     *
     * @param appId
     * @param versionId
     * @return
     */
    @PostMapping("code/commit")
    String commit(@RequestParam("appId") String appId, @RequestParam("versionId") Integer versionId, @RequestParam("submitAudit") boolean submitAudit);

    /**
     * 发布小程序
     *
     * @return
     */
    @PostMapping("code/release")
    String release(@RequestParam("versionId") Integer versionId, @RequestParam("appId") String appId);

    /**
     * 获取体验码权限
     *
     * @param appId
     * @return
     */
    @PostMapping("code/getQrCode")
    String getQrCode(@RequestParam("appId") String appId);

    /**
     * 获取审核结果
     *
     * @param versionId
     * @param appId
     * @param release
     * @return
     */
    @PostMapping("code/getLatestAuditStatus")
    String getLatestAuditStatus(@RequestParam("versionId") Integer versionId, @RequestParam("appId") String appId, @RequestParam("release") boolean release);

    /**
     * 提交审核
     *
     * @param versionId
     * @param appId
     * @return
     */
    @PostMapping("code/submitAudit")
    String submitAudit(@RequestParam("versionId") Integer versionId, @RequestParam("appId") String appId);

    @PostMapping("code/undoCodeAudit")
    String undoCodeAudit(@RequestParam("appId") String appId);
}
